Attribute Grammars and Folds : Generic Control Operators

نویسندگان

  • Etienne Duris
  • Didier Parigot
  • Gilles Roussel
  • Martin Jourdan
چکیده

Generic control operators, such as fold, have been introduced in functional programming to increase the power and applicability of data-structure-based transformations. This is achieved by making the structure of the data more explicit in program speciications. We argue that this very important property is one of the original concepts of attribute grammars. In this paper, we informally show the similarities between the fold formalism and attribute grammar speciications. We also compare their respective method to eliminate the intermediate data structures introduced by function composition (notion of deforestation or fusion): the normalization algorithm for programs expressed with folds and the descriptional composition of attribute grammars. Rather than identify the best way to achieve deforestation, the main goal of this paper is merely to intuitively present two programming paradigms to each other's supporting community and provide an unbiased account of their similarities and diierences, in the hope that this leads to fruitful cross-fertilization. Grammaires Attribuues et Folds : Oprateurs de Contrrle GGnnriques RRsumm : Les oprateurs de contrrle ggnnriques tels que fold ont tt introduits dans la pro-grammation fonctionnelle pour augmenter la puissance et le champs d'application des transformations basses sur la structure des donnnes. Ceci est obtenu en rendant la structure des donnnes plus explicite dans la spciication des programmes. Nous considdrons que cette caracttristique fondamentale est l'un des concepts de base des grammaires attribuues. Dans cet article, nous exposons informellement les similitudes entre le formalisme du fold et la spciication des grammaires attribuues. Nous comparons gale-ment leurs mmthodes respectives d''limination des structures intermmdiaires introduites par la composition de fonctions (notion de ddforestation ou de fusion) : l'algorithme de normalisa-tion pour les programmes exprimms l'aide de folds et la composition descriptionnelle pour les grammaires attribuues. Pluttt que de ddterminer la meilleure faaon d'eeectuer la ddforestation, le but principal de cet article est simplement de prrsenter intuitivement chacun de ces deux paradigmes de pro-grammation la communautt qui soutient l'autre, et de ddcrire objectivement leurs similitudes et leur diiirences, dans l'espoir que cela conduise des fertilisations croisses fructueuses.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Attribute Grammars and Functional Programming Deforestation

The functional programming community is paying increasing attention to static structure-based transformations. For example, generic control operators , such as fold, have been introduced in functional programming to increase the power and applicability of a particular kind of static transformation, called deforestation, which prevents the construction of useless intermediate data structures in ...

متن کامل

Structure-directed Genericity in Functional Programming and Attribute Grammars

Generic control operators, such as fold, have been introduced in functional programming to increase the power and applicability of data-structure-based transformations. This is achieved by making the structure of the data more explicit in program speciications. We argue that this very important property is one of the original concepts of attribute grammars. In this paper, we present the similar...

متن کامل

Decorated Attribute Grammars: Attribute Evaluation Meets Strategic Programming

Attribute grammars are a powerful specification formalism for treebased computation, particularly for software language processing. Various extensions have been proposed to abstract over common patterns in attribute grammar specifications. These include various forms of copy rules to support non-local dependencies, collection attributes, and expressing dependencies that are evaluated to a fixed...

متن کامل

Attribute Evaluation Meets Strategic Programming

Attribute grammars are a powerful specification formalism for tree-based computation, particularly for software language processing. Various extensions have been proposed to abstract over common patterns in attribute grammar specifications. These include various forms of copy rules to support non-local dependencies, collection attributes, and expressing dependencies that are evaluated to a fixe...

متن کامل

Trapezoidal intuitionistic fuzzy prioritized aggregation operators and application to multi-attribute decision making

In some multi-attribute decision making (MADM) problems, various relationships among the decision attributes should be considered. This paper investigates the prioritization relationship of attributes in MADM with trapezoidal intuitionistic fuzzy numbers (TrIFNs). TrIFNs are a special intuitionistic fuzzy set on a real number set and have the better capability to model ill-known quantities. Fir...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1996